<div id="list">
    <table class="table table-bordered">
        <thead>
        <tr>
            <td colspan="4">
                <button class="btn btn-xs btn-primary" ng-click="postContent()">添加内容
                </button>
                <button class="btn btn-xs btn-danger" ng-click="deleteContentArray(deleteArray)">批量删除
                </button>

            </td>
        </tr>
        <tr>
            <th width="3%"><input type="checkbox" ng-click="setAllToArray(isSetAll)" ng-model="isSetAll">
            </th>
            <th>标题</th>
            <th>作者</th>
            <th class="text-center">操作</th>
        </tr>
        </thead>
        <tbody>
        <tr ng-repeat="post in contents">
            <td><input type="checkbox" ng-model="post.isChecked" ng-click="setIdToArray(post)"></td>
            <td><span>{{post.title}}</span></td>
            <td><span>{{post.name}}</span></td>
            <td class="text-center">
                <div class="btn-group">
                    <button class="btn btn-xs btn-primary" ng-click="edit(post)">编辑</button>
                    <button class="btn btn-xs  btn-danger" ng-click="deleteContentById(post._id)">删除
                    </button>
                </div>
            </td>
        </tr>

        </tbody>

    </table>

    <div class="text-center">
        <div class="pagination">
            <li><a ng-click="getContentsByPage(page-1)">&laquo;</a></li>
            <li><a ng-click="getContentsByPage(page-2)" ng-show="page-2>0">{{page-2}}</a></li>
            <li><a ng-click="getContentsByPage(page-1)" ng-show="page-1>0">{{page-1}}</a></li>
            <li class="active"><a ng-click="getContentsByPage(page)">{{page}}</a></li>
            <li><a ng-click="getContentsByPage(page+1)" ng-show="page+1<=total">{{page+1}}</a></li>
            <li><a ng-click="getContentsByPage(page+2)" ng-show="page+2<=total">{{page+2}}</a></li>
            <li><a ng-click="getContentsByPage(page+1)">&raquo;</a></li>
        </div>
    </div>
</div>